package com.wmx.jdbc_template_app;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

/**
 * Spring boot 服务启动类
 *
 * @author wangMaoXiong
 */
@SpringBootApplication
public class JdbcTemplateAppApplication {

    private static ApplicationContext applicationContext;

    public static void main(String[] args) {
        applicationContext = SpringApplication.run(JdbcTemplateAppApplication.class, args);
        String[] beanDefinitionNames = applicationContext.getBeanDefinitionNames();
        System.out.println("========服务启动成功，IOC容器中实例如下：");
        int count = 1;
        for (String beanDefinitionName : beanDefinitionNames) {
            System.out.println((count++) + "：实例名称：" + beanDefinitionName + "，类型：" + applicationContext.getBean(beanDefinitionName).getClass());
        }
    }

}
